package priv.xml;

import java.text.SimpleDateFormat;
import java.util.Date;

import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.ImportResource;


@Configuration
@ImportResource(locations= {"classpath:zongjingli.cfg.xml","classpath:xiaoming.cfg.xml","classpath:siji.cfg.xml","classpath:mishu.cfg.xml"})
public class MainWork2 {
	@SuppressWarnings("resource")
	public static void main(String[] args) {
	ApplicationContext context = 
			new AnnotationConfigApplicationContext(MainWork2.class);
	Date date = (Date) context.getBean("xiaoming_birthday");
	SimpleDateFormat simpleDateFormat = context.getBean(SimpleDateFormat.class);
	System.out.println(simpleDateFormat.format(date));
	
	XiaoMing xiaoMing = context.getBean(XiaoMing.class);
	System.out.println(xiaoMing);
	
	XiaoFang xiaoFang = context.getBean(XiaoFang.class);
	System.out.println(xiaoFang);
	
	ZongJingLi zongJingLi = context.getBean(ZongJingLi.class);
	System.out.println(zongJingLi);
	
	SiJi siJi = context.getBean(SiJi.class);
	System.out.println(siJi);
	
	MiShu miShu = context.getBean(MiShu.class);
	System.out.println(miShu);
	
	}
}
